//
//  UrbanMyTableViewCell.m
//  UrbanManagement
//
//  Created by Can on 18/4/12.
//  Copyright © 2018年 hwd. All rights reserved.
//

#import "UrbanMyTableViewCell.h"
#import "UrbanCustomMethod.h"

@implementation UrbanMyTableViewCell

// 1. 初始化子视图
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        self.selectionStyle = 0;
        
        [self creatView];
    }
    
    return self;
}

- (void)creatView{
    
    for (UIView *subView in self.contentView.subviews)
    {
        [subView removeFromSuperview];
    }
    
    //左侧图标
    _imageV = [[UIImageView alloc]initWithFrame:CGRectMake(15*screenW_6, 15*screenW_6, 20*screenW_6, 18*screenW_6)];
    [self.contentView addSubview:_imageV];
    
    //title
    _titleLable = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_imageV.frame) + 25/2*screenW_6, 35/2*screenW_6, SCREENW - CGRectGetMaxX(_imageV.frame) - 25/2*screenW_6, 15*screenW_6)];
    _titleLable.textAlignment = NSTextAlignmentLeft;
    _titleLable.textColor = Color(51, 51, 51);
    [self.contentView addSubview:_titleLable];
    
    //右侧title
    _msgLable = [[UILabel alloc]initWithFrame:CGRectMake(0, 35/2*screenW_6, SCREENW - 95/2*screenW_6, 15*screenW_6)];
    _msgLable.textAlignment = NSTextAlignmentRight;
    _msgLable.textColor = Color(153, 153, 153);
    [self.contentView addSubview:_msgLable];
    
    //右侧图标
    UIImageView *imageView = [TomamaUI createImageView:CGRectMake(CGRectGetMaxX(_msgLable.frame) + 25*screenW_6, 0, 7*screenW_6, 12*screenW_6) backGroundImageV:@"right_arrow"];
    [self.contentView addSubview:imageView];
    imageView.center = CGPointMake(imageView.center.x, _msgLable.center.y);
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
